package com.mk.model.entity;

import com.baomidou.mybatisplus.annotation.*;
import lombok.Builder;
import lombok.Data;

import java.io.Serializable;
import java.util.Date;

/**
 * 用户
 * @TableName user
 */
@TableName(value ="user")
@Data
@Builder
public class User implements Serializable {
    /**
     * id 指定主键生成策略 随机ID
     */
    @TableId(type = IdType.ASSIGN_ID)
    private Long id;

    /**
     * 用户账号
     */
    private String userAccount;

    /**
     * 用户密码
     */
    private String userPassword;

    /**
     * 用户昵称
     */
    private String userNick;

    /**
     * 用户头像
     */
    private String userAvatar;

    /**
     * 用户简介
     */
    private String userProfile;

    /**
     * 用户角色：user-普通用户/admin-管理员
     */
    private String userRole;

    /**
     * 编辑时间：用户自主编辑时间
     */
    private Date editTime;

    /**
     * 创建时间
     */
    private Date createTime;

    /**
     * 更新时间：系统更新时间
     */
    private Date updateTime;

    /**
     * 是否删除：0-false / 1-删除
     */
    @TableLogic
    private Integer isDelete;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;
    /**
     * 静态内部类，用于存储字段名常量
     */
    public static class Fields {
        public static final String ID = "id";
        public static final String USER_ACCOUNT = "userAccount";
        public static final String USER_PASSWORD = "userPassword";
        public static final String USER_NICK = "userNick";
        public static final String USER_AVATAR = "userAvatar";
        public static final String USER_PROFILE = "userProfile";
        public static final String USER_ROLE = "userRole";
        public static final String EDIT_TIME = "editTime";
        public static final String CREATE_TIME = "createTime";
        public static final String UPDATE_TIME = "updateTime";
        public static final String IS_DELETE = "isDelete";
    }
}
